package com.sky.controller.admin;

import com.sky.result.Result;
import com.sky.utils.AliOSSUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
@Slf4j
@Api(tags = "文件上传模块")
public class FileUploadController {
    @PostMapping("/admin/common/upload")
    @ApiOperation("文件上传")
    public Result uploadfile(MultipartFile file)throws IOException {
        String image_url = AliOSSUtils.upload(file);
        return Result.success(image_url);
    }
}
